import service from "@/utils/request";

import { method } from "lodash";
import { url } from "inspector";

const DEP_BASE_URL = "/api/";

class starts {
  static GetEate() {
    return service({
      url: `${DEP_BASE_URL}DeathModel/GetEweEarTagsFromSheepFile`,
      method: "get",
    });
  }

  static GetCause() {
    return service({
      url: `${DEP_BASE_URL}DeathModel/Showcause`,
      method: "get",
    });
  }

  static FindEarTag(EarTagdata: any) {
    return service({
      url: `${DEP_BASE_URL}DeathModel/GetBuildByEar`,
      method: "get",
      params: {
        earTagNumbe: EarTagdata,
      },
    });
  }

  static Addinfo(data?: any) {
    return service({
      url: `${DEP_BASE_URL}DeathModel/AddManager`,
      method: "post",
      data,
    });
  }

  static getList(queryParams?: DetathShow) {
    return service<any, DetathShow>({
      url: `${DEP_BASE_URL}DeathModel/GetShow`,
      method: "get",
      params: queryParams,
    });
  }
  static deleteDeath(id: number) {
    return service({
      url: `${DEP_BASE_URL}DeathModel/Delete`,
      method: "delete",
      data: {
        id: id,
      },
    });
  }

  static Finds(deathId: any) {
    return service({
      url: `${DEP_BASE_URL}DeathModel/GetFind`,
      method: "get",
      params: {
        id: deathId,
      },
    });
  }

  static DeathDeleteRan(ids: any) {
    return service({
      url: `${DEP_BASE_URL}DeathModel/DeleteRange`, // 使用一个专门的接口来支持批量删除
      method: "put",
      data: {
        ids: ids, // 将要删除的ID列表发送到后端
      },
    });
  }
}

export default starts;

export interface DetathModel {
  deathDate: string;
  earTag: string;
  deathType: number;
  variety: number;
  sheepRescissionSex: boolean;
  reproductiveState: number;
  buildingManagementId: number;
  columnManagementId: number;
}
export interface DetathShow {
  EarTag: string;
  DeathType: number;
  PageIndex: number;
  PageSize: number;
}

export interface DetathShow {
  EarTag: string;
  DeathType: number;
  PageIndex: number;
  PageSize: number;
}


export interface Eliminamodel {
  earTag: string;
  variety: number;
  buildingManagementId: number;
  columnManagementId: number;
  siwang: string;
  departureState: boolean;
  treatmentMeasure: number;
  
}